 Component({
   properties: {
     text: { // 属性名
       type: Boolean,
       value: "true",
       observer: function (newVal, oldVal) {

       }
     },
   },
   data: {
     text1: "",
     //  show: true,
     username: "羊吃毛",
     left1: [{
       "icon": "icon-xinfengyoujian",
       "title": "我的信息"
     }, {
       "icon": "icon-yun",
       "title": "云贝中心"
     }, {
       "icon": "icon-deng-",
       "title": "创作者中心"
     }, ],
     left2: [{
       "icon": "icon-gouwuche",
       "title": "商城"
     }, {
       "icon": "icon-naozhong",
       "title": "音乐闹钟"
     }, {
       "icon": "icon-lingdang",
       "title": "口袋彩铃"
     }, ],
     left3: [{
       "icon": "icon-shezhi",
       "title": "设置"
     }, {
       "icon": "icon-fenxiang1",
       "title": "分享网易云音乐"
     }, {
       "icon": "icon-guanyu",
       "title": "关于"
     }, ],
     userName: '',
     headerurl: "",
   },
   lifetimes: {
     // 生命周期函数，可以为函数，或一个在methods段中定义的方法名
     attached: function () {},
     moved: function () {},
     detached: function () {},
   },

   // 生命周期函数，可以为函数，或一个在methods段中定义的方法名
   attached: function () {}, // 此处attached的声明会被lifetimes字段中的声明覆盖
   ready: function () {},

   pageLifetimes: {
     // 组件所在页面的生命周期函数
     show: function () {
       this.data.show = true;
       if (wx.getStorageSync('token') == 1) {
         if (wx.getStorageSync('headerurl') != "http://192.168.0.26:8081null"){
           this.setData({
             headerurl: wx.getStorageSync('headerurl')
           })
         }else{
           this.setData({
            headerurl:""
           })
         }
           this.setData({
             userName: wx.getStorageSync('userName')
           })

       } else {
         this.data.show = false;
       }
       //  console.log(this.data.text);
       //  this.setData({
       //    text1: this.data.text
       //  })
       //  console.log(this.data.text1);
       // console.log(123);
       // console.log(this.data.text);
       //  console.log(this.data.text);

     },
     hide: function () {
       //  console.log(123);
     },
     resize: function () {
       //  console.log(123);
     },
   },
   methods: {
     // 我的详情页
     userinfo() {
       wx.navigateTo({
         url: '../userinfo/userinfo',
       })
     },
     quit() {
       wx.setStorageSync('token', 0),
         //  this.onReady() 
         wx.navigateTo({
           url: "../login/login"
         })
     },
     //  updata() {
     //    console.log(321);
     //  }
   }
 })